package com.example.train_operate.util;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import static com.example.train_operate.constants.YunXinConstants.*;

public class RequestHeadUtil {

    public static Map<String, String> SetRequestHead(){
        String nonce = RandomUtil.generateRandomString(UPPERCASE + LOWERCASE + DIGITS, new Random());
        Map<String, String> headers = new HashMap<>();
        headers.put("AppKey", APP_KEY);
        headers.put("Nonce", nonce);
        headers.put("CurTime", String.valueOf(System.currentTimeMillis() / 1000));
        headers.put("CheckSum", RandomUtil.getCheckSum(APP_SECRET, nonce));
        return headers;
    }

}
